import FsmBase from "./FsmBase";
import { FsmState } from "./FsmState";
import {IFsm} from "./IFsm";

export interface IFsmManager {
    /// <summary>
    /// 获取有限状态机数量。
    /// </summary>
     Count():number;


/// <summary>
/// 检查是否存在有限状态机。
/// </summary>
/// <typeparam name="T">有限状态机持有者类型。</typeparam>
/// <returns>是否存在有限状态机。</returns>
HasFsm<T>(name:string,owner?):boolean;





/// <summary>
/// 获取有限状态机。
/// </summary>
/// <typeparam name="T">有限状态机持有者类型。</typeparam>
/// <returns>要获取的有限状态机。</returns>
 GetFsm<T>(name:string,owner?):IFsm<T>|FsmBase;



/// <summary>
/// 获取所有有限状态机。
/// </summary>
/// <returns>所有有限状态机。</returns>
 GetAllFsms<T>():IFsm<T>[]|FsmBase[];



/// <summary>
/// 创建有限状态机。
/// </summary>
/// <typeparam name="T">有限状态机持有者类型。</typeparam>
/// <param name="owner">有限状态机持有者。</param>
/// <param name="states">有限状态机状态集合。</param>
/// <returns>要创建的有限状态机。</returns>
 CreateFsm<T>(owner,name:string,states:FsmState<T>[]):IFsm<T>|FsmBase;





/// <summary>
/// 销毁有限状态机。
/// </summary>
/// <typeparam name="T">有限状态机持有者类型。</typeparam>
/// <param name="name">要销毁的有限状态机名称。</param>
/// <returns>是否销毁有限状态机成功。</returns>
 DestroyFsm<T>( name:string,owner?:T|IFsm<T>|FsmBase):boolean;


}